<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>自定义函数</title>
		<script>
			function add( a,b){
				return a+b;
			}
			alert(add(5,4));
			alert(add("hello","java"));
			function sayhi(n){
				//alert("hello,js");
				for(var i=1;i<=n;i++){
					document.write("<h1>javascript一统江湖，千秋万代</h1>");
				}
			}
		</script>
	</head>
	<body>
		<div id="d1" onclick="sayhi(prompt(\"请输入一个数字\",\"3\"))" style="height: 340px; border: 4px outset green;">
			wee
		</div>
		<input type="button" value="sayhi"  onclick="sayhi(prompt('清输入一个数字','1'))"/>
	</body>
</html>
